package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoSchoolArticle;
import com.sc.nft.entity.dto.DaoSchoolArticleNotChildIdPageListDTO;
import com.sc.nft.entity.vo.ArticleDetailsVO;
import com.sc.nft.entity.vo.DaoSchoolArticlePageAdminVO;
import com.sc.nft.entity.vo.DaoSchoolTopHomeArticleListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 文章表(DaoSchoolArticle)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-13 16:20:43
 */
public interface DaoSchoolArticleMapper extends BaseMapper<DaoSchoolArticle> {

    /**
     * 后台获取分页列表
     *
     * @param pageRequest
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> pageAdmin(Page page);

    /**
     * 获取没有被某个子集选中的文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> selectByNotChildIdPageList(Page page, @Param("data") DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 获取首页推荐文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> homePageAdmin(Page page, @Param("data") DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 获取没有被置顶的文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> selectByNotTopArticle(Page page, @Param("data") DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 获取首页文章
     *
     * @return
     */
    List<DaoSchoolTopHomeArticleListVO> getHomeTopArticle(@Param("daoId") Long daoId);

    /**
     * 通过id获取文章
     *
     * @param articleId
     * @return
     */
    ArticleDetailsVO byIdGetArticle(@Param("id") Long articleId);

}
